//
//  UserAction.swift
//  压岁_IOS
//
//  Created by 梓简王 on 2017/7/14.
//  Copyright © 2017年 梓简王. All rights reserved.
//

import Foundation



class UserAction {
    static func saveLocalUserInfo(){
        let tempDic = commonVariable.LOCAL_USER!.toDict() as! NSDictionary
        tempDic.writeToFile(commonVariable.USERINFOPATH, atomically: true)
    }
    
    static func getLocalUserInfo() -> User?{
        let userDic = NSDictionary(contentsOfFile: commonVariable.USERINFOPATH)
        if(userDic == nil){ return nil }
        return User.parse(dict: userDic!)
    }
}